<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		<meta name="description" content="">
		<title></title>
		<link rel="stylesheet" href="../imgv2/css/default.min.css" />
		<link href="../imgv2/css/css.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="../jsv2/bootstrap/css/bootstrap-ico.css" />
		<style>
			body {
				background-color: rgba(241, 241, 241, 1);
				/*overflow-y: hidden;*/
			}
			.title {
				height: 32px;
				line-height: 32px;
				background-color: rgba(150, 204, 112, 1);
				color: rgba(255, 255, 255, 1);
				font-size: 13px;
			}
			.map-view {
				width: 100%;
			}
			.address-name{
				height: 36px;
				width: 100%;
				position: fixed;
				left: 0px;
				bottom: 0px;
				background-color: rgba(255,255,255,1);
				z-index: 400;
				box-shadow: -1px 0px 1px rgba(222,222,222,1);
			}
			.address-name i{
				line-height: 36px;
			}
			.address-name .address-txt{
				margin-left: 10px;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
		</style>
	</head>

	<body>
		<div id="headerview" style="height: 44px;">
			<div class="cm-header cm-header--no-right" id="ui-view-16">
				<span class="cm-header-icon fl js_back">
          			<i class="icon-back"></i>
      			</span>
				<h1 class="cm-page-title js_title">地图上预览目的地</h1>
			</div>
		</div>
		<div class="map-view" id="iCenter"></div>
		<div class="address-name"><i class="iconfont">&#xe606;</i><i class="address-txt"></i></div>
	</body>
	<script src="../jsv2/jQuery/jquery-1.11.2.min.js"></script>
	<script src="http://webapi.amap.com/maps?v=1.3&key=57c58c7b1f94514317df97e3a985962c"></script>
	<script src="../jsv2/lib/k-utils-fn.js"></script>
	<script src="../jsv2/journey/operateData.js"></script>
	<script src="../jsv2/AMapCommon.js"></script>
	<script>
		var parentwin = window.parent,
			kmap, geoCenter = null;
		$(function() {
			showMaskLoading();
			$('#iCenter').css({
				'height': (K.getPageSize()[1] - 44) + 'px'
			});
			//初始化地图
			kmap = new KAMap({
				render: 'iCenter'
			});
			kmap.mapInit();
			setCneter();
			closemaskLoading();//关闭这招层
		});

		function setCneter() {
			if (parentwin) {
				geoCenter = parentwin.getGEOCenter(); //获取上一步得到的地址
				if (geoCenter) {
					kmap.setCenter(new AMap.LngLat(geoCenter.location.lng,geoCenter.location.lat));
					kmap.addmarker(0, geoCenter);
					$('.address-name .address-txt').html(geoCenter.name);
				}
			}
		}
	</script>

</html>